package main

import (
	"fmt"
	"math"
	"math/cmplx"
)

func main() {
	fmt.Println("yuanpengyue")
	//time.Sleep(time.Duration(time.Second * 3))
	//fmt.Println("你好")
	// 欧拉公式
	euler()
	// 常量
	consts()
	// 枚举常量
	enums()

}

func euler() {
	c := 3 + 4i
	fmt.Println(cmplx.Abs(c))
}

func consts() {
	const filename = "abc.txt"
	const a, b = 3, 4
	var c int
	c = int(math.Sqrt(a*a + b*b))
	fmt.Println(filename, c)
}

func enums() {
	const (
		//cpp    = 0
		//java   = 1
		//python = 2
		//golang = 3
		cpp = iota
		_
		java
		python
		golang
	)
	//b kb mb,gb,tb,pb
	const (
		b = 1 << (10 * iota)
		kb
		mb
		gb
		tb
		pb
	)
	fmt.Println(cpp, java, python, golang)
	fmt.Println(b, kb, mb, gb, tb, pb)
}
